package com.qingcheng.controller.order;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.pojo.order.CategoryReport;
import com.qingcheng.service.order.CategoryReportService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * @Author:boy
 * @Date:2019/7/1
 * @description:
 * @ModifiedBy:
 */
@RestController
@RequestMapping("/categoryReport")
public class CategoryReportController {
    @Reference
    private CategoryReportService categoryReportService;

    @RequestMapping("/yesterday")
    public List<CategoryReport> yesterday() {
        LocalDate date = LocalDate.now().minusDays(1);
        return categoryReportService.categoryReport(date);
    }
    @RequestMapping("/category1Count")
    public List<Map> category1Count(String date1, String date2){
        return categoryReportService.category1Count(date1,date2);
    }

}
